<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
                xmlns:testng="http://testng.org">

    <xsl:template name="top-level-task-result">
        <table class="task-container">
            <tr>
                <td class="task-main"><xsl:call-template name="task-result" /></td>
                <td class="task-spacer" />
            </tr>
        </table>
    </xsl:template>
    
    <xsl:template name="task-result">
        <div class="task">
            <table class="task-result">
                <tr class="task-header">
                    <th class="task-name"><xsl:value-of select="@name" /></th>
                    <th class="task-params"><xsl:value-of select="@params" /></th>
                    <!-- <th class="task-start-time"><xsl:value-of select="substring(@started-at, 12, 8)" /></th> -->
                    <th class="task-duration"><xsl:value-of select="testng:formatDuration(@duration-ms)"/></th>
                    <th class="task-emoticon">
                        <xsl:choose>
                            <xsl:when test="@status = 0">:)</xsl:when>
                            <xsl:when test="@status = 1">:?</xsl:when>
                            <xsl:when test="@status = 2">:(</xsl:when>
                            <xsl:when test="@status = 3">:O</xsl:when>
                        </xsl:choose>
                    </th>
                    <th class="task-display-level" />
                </tr>
                <tr class="task-info">
                    <td>Description</td>
                    <td colspan="4"><xsl:value-of select="@description" /></td>
                </tr>
                <tr class="task-info" style="display: none">
                    <td>Status</td>
                    <td class="task-status" colspan="4"><xsl:value-of select="@status" /></td>
                </tr>
                <tr class="task-info">
                    <td>Message</td>
                    <td colspan="4"><xsl:value-of select="@message" /></td>
                </tr>
                <tr class="task-info">
                    <td>Response Data</td>
                    <td class="response-data" colspan="4"><xsl:value-of select="response-data" /></td>
                </tr>
            </table>
            <div class="nested-results">
                <xsl:for-each select="nested-results/task-result">
                    <xsl:call-template name="task-result" />
                </xsl:for-each>
            </div>
        </div>
    </xsl:template>

</xsl:stylesheet> 